package com.hziee.graduate.ticket.controller;

import com.hziee.graduate.ticket.dto.R;
import com.hziee.graduate.ticket.entity.Cinema;
import com.hziee.graduate.ticket.service.CinemaService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("cinema")
public class CinemaController {

    @Resource
    CinemaService cinemaService;

    @PostMapping("addCinema")
    public R<Object> addCinema(@RequestBody Map<String, Object> map) {
        return cinemaService.addCinema(map);
    }

    @PostMapping("getCinemaByRegionId")
    public R<List<Cinema>> getCinemaByRegionId(@RequestBody Map<String, String> map) {
        return cinemaService.getCinemaByRegionId(map);
    }

    @GetMapping("delCinema/{id}")
    public R<Object> delCinema(@PathVariable Integer id) {
        return cinemaService.delCinema(id);
    }
}

